pub fn odd_fibnacci_sum(threshold: u32) -> u32 {
    if threshold == 0 {
        return 0;
    } else if threshold == 1 {
        return 2;
    }
    let (mut x0, mut x1) = (0, 1);
    let mut x2: u32 = x0 + x1;
    let mut res = 1;
    while x2 <= threshold {
        if x2 % 2 == 1 {
            res += x2;
        }
        x0 = x1;
        x1 = x2;
        x2 = x0 + x1;
    }
    res
}
